<?php
namespace app\shop31\model;

use think\Model;

class Order extends Model
{
    public function searchCidAttr($q,$v)
    {
        $q->where('status','=',"{$v}");
    }

    public function searchNameAttr($q,$v)
    {
        $q->where('aname','like',"%{$v}%");
    }

    public function searchNum1Attr($q,$v)
    {
        $q->where('price','<=',"{$v}");
    }

    public function searchNum2Attr($q,$v)
    {
        $q->where('price','>=',"{$v}");
    }






    public static function GetOrderList($where,$param)
    {
        $adv=Order::withSearch(array_keys($where),$where)
            ->paginate([
                'list_rows'=>3,
                'query' => $param
            ]);
        return $adv;

    }
}